import os
import platform

if platform.system() == 'Darwin':
	t = 'webkit.tmp'
	s = 'WebKit.app'
	if os.path.exists(s):
		if not os.path.exists(t):
			print("Found WebKit in project root - linking...")
			os.popen('mkdir -p %s/include %s/lib' % (t, t))
			os.popen('ln -s ../../%s/Contents/Frameworks/10.5/JavaScriptCore.framework/Headers %s/include/JavaScriptCore' % (s, t))
			os.popen('ln -s ../../%s/Contents/Frameworks/10.5/JavaScriptCore.framework/JavaScriptCore %s/lib/libwebkit-1.0.a' % (s, t))
	else:
		print("Put WekKit in project root folder.")

build = SConscript([
	'kit/SConscript',
	'uth/SConscript',
	'phnqlets/SConscript',
	'babel/SConscript',
	'stack/SConscript',
	'examples/SConscript',
	'phnq.org/SConscript'
])
